<!DOCTYPE html>
<html lang="zh-cn">
   <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>{$CONF['mallTitle']}帖子详情</title>
      <link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="__CSS__/AdminLTE.css" rel="stylesheet" type="text/css" />
      <script src="__PUBLIC__/js/jquery.min.js"></script>
      <script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
      <script src="__PUBLIC__/js/common.js"></script>
     
      <script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
      <style>
		.num,.current{padding:10px;display:inline-block;}
	.isShow,.del{cursor:pointer;}
	.btns,.isShow{padding:5px 15px; border:#ccc solid 1px; margin:10px;text-indent:0px;border-radius:3px; cursor:pointer}
  #content  img{width:20px;height:20px;}
  #helpImg{width:200px;height:200px;float:left;text-align: center;margin:0 10px;}
  #helpImg img{vertical-align: middle;max-width: 200px;max-height: 200px;}
	</style>
   </head>
   <body class='wst-page'>
      <style>
       #posts th{text-align:right;}
       </style>
       <div class='wst-tbar' style='height:25px;'>
	       <button type="button" class="btn btn-primary" style="float:right" onclick='javascript:location.href="{$referer}"'>返&nbsp;回</button>
	       </div>
       <div class="wst-body"> 
        <table class="table table-hover table-striped table-bordered wst-list" id="posts">
           <tbody>
             <tr>
                 <th style="width:110px; height:40px;">发布时间</th>
                 <td style="text-indent:10px;width:200px;">
                   {$object['createTime']}
                 </td>
                 <th style="width:110px; height:40px;">状态(单击修改)</th>
                 <td style="text-indent:10px;">
                   <span id="isShow" class="btns" data-id="{$object['id']}" data-status="{$object['isShow']}"> <if condition="$object['isShow'] eq 1">显示<else/>隐藏</if></span>
                 </td>
             </tr>
             <tr>
                <th style="width:110px; height:40px;">发帖人ID</th>
                <td style="text-indent:10px;">
                {$object['userId']}
                 </td>
                 <th style="width:110px; height:40px;">发帖人名称</th>
                 <td style="text-indent:10px;">
				<if condition="$object['userName'] neq ''">		
                	{$object['userName']}
                	<else />
                	{$object['loginName']}
                </if>
                 </td>
             </tr>
             <tr>
                <th style="width:110px; height:40px;">范围</th>
                <td style="text-indent:10px;">
                	{$object['range']}KM
                 </td>
                 <th style="width:110px; height:40px;">地址</th>
                 <td style="text-indent:10px;">
					{$object['address']}
                 </td>
             </tr>
             <tr>
                <th style="width:110px; height:40px;">价格</th>
                <td style="text-indent:10px;">
                	{$object['money']}
                 </td>
                 <th style="width:110px; height:40px;">提取方式</th>
                 <td style="text-indent:10px;">
						<if condition="$object['delivery'] eq 1">		
		                	自提
		                	<else />
		                	送货上门
		                </if>
                 </td>
             </tr>
             <tr>
                 <th style="width:110px; height:40px;">分类</th>
                 <td style="text-indent:10px;" colspan="3">
                 {$object['cateName']}
                 </td>
             </tr>
             <tr>
                 <th style="width:110px; height:40px;">标题</th><td style="text-indent:10px;" colspan="3">{$object['title']}</td>
             </tr>
             <tr>
                 <th style="width:110px; height:40px;">内容</th><td style="text-indent:10px;" colspan="3" id="content">{$object['content']}</td>
             </tr>
             <tr>
                 <th style="width:110px; height:40px;">图片</th><td style="text-indent:10px;" colspan="3" id="img">
                 <if condition="$object['img'] neq ''">
                 <volist name="object['img']" id="vo">
                  <div id="helpImg"><img src="__ROOT__/{$vo}" /></div>
                 </volist>
                 </if>
                 </td>
             </tr>
            
           </tbody>
        </table>
       </div>
   </body>
   <script>
	   //修改帖子状态
	   $('body').on('click','#isShow',function(){
		   var _this=$(this);
		   var text=$(this).text();
		   var isShow=$(this).attr('data-status');
		   if(isShow==0){
			   isShow=1;
			   text='显示';
		   }else{
			   isShow=0;
			   text='隐藏';
		   }
		   var id=$(this).attr('data-id');
		   $.ajax({
				  type: "POST",
				  url: "{:U('Admin/Help/editIsShow')}",
				  data: {
				      id:id,
				      isShow:isShow
				  },
				  dataType: "json",
				  success: function(data){
					  if(data.status==1){
						  Plugins.Tips({title:'信息提示',icon:'error',content:'操作成功!',timeout:1000});
						  $(_this).text(text);
						  $(_this).attr('data-status',isShow);
					  }else{
						  Plugins.Tips({title:'信息提示',icon:'error',content:'操作失败!',timeout:1000});
					  }
				  }
				});
	   })
   </script>
</html>